<template>
  <view class="bottom-action-bar">
    <view class="divider-line"></view>
    <view class="action-content">
      <view class="share-section" @click="handleShare">
        <image
            class="share-icon"
            referrerpolicy="no-referrer"
            src="https://tg-spcs.oss-cn-hangzhou.aliyuncs.com/static/images/activity_pile/invite%402x.png"
        />
        <text class="share-text">
          邀请领
          <br />
          200元红包
        </text>
      </view>
      <view class="purchase-section" @click="handlePurchase">
        <text class="purchase-text">{{ purchaseText }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'BottomActionBar',
  props: {
    purchaseText: {
      type: String,
      default: '立即购买 免费安装'
    }
  },
  methods: {
    handleShare() {
      this.$emit('share');
    },
    handlePurchase() {
      this.$emit('purchase');
    }
  }
}
</script>

<style scoped>
.bottom-action-bar {
  background-color: rgba(255, 255, 255, 1);
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 72px;
  z-index: 999;
}

.divider-line {
  width: 100%;
  /* height: 1px; */
  border: 1px solid #DCDFEC;
}

.action-content {
  width: calc(100% - 34px);
  margin: 7px 16px 0 18px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.share-section {
  width: 94px;
  margin: 7px 0 7px 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.share-icon {
  width: 32px;
  height: 32px;
  /*margin: 9px 0 9px 0;*/
}

.share-text {
  width: 58px;
  height: 34px;
  overflow-wrap: break-word;
  color: rgba(28, 204, 180, 1);
  font-size: 12px;
  font-family: PingFangSC-Medium;
  font-weight: 500;
  text-align: left;
  line-height: 17px;
}

.purchase-section {
  background-color: rgba(28, 204, 180, 1);
  border-radius: 30px;
  padding: 12px 8%;
  flex: 1;
  margin-left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.purchase-text {
  overflow-wrap: break-word;
  color: rgba(255, 255, 255, 1);
  font-size: 18px;
  font-family: PingFangSC-Medium;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  line-height: 25px;
}
</style>
